package com.vdg.data;

import android.content.Context;
import android.content.pm.ApplicationInfo;

public class AppInformation extends ApplicationInfo implements
		Comparable<AppInformation> {
	private boolean mIsSelected;
	private String mName;

	public boolean isIsSelected() {
		return mIsSelected;
	}

	public String getName() {
		return mName;
	}

	public AppInformation(ApplicationInfo infor, boolean isSelected, String name) {
		super(infor);
		this.mIsSelected = isSelected;
		mName = name;
		// TODO Auto-generated constructor stub
	}

	public void setIsSelected(boolean mIsSelected) {
		this.mIsSelected = mIsSelected;
	}

	@Override
	public int compareTo(AppInformation val) {
		String name1 = val.getName();
		if (name1.length() == 0 && mName.length() > 0) {
			return -1;
		}
		if (name1.length() == 0 && mName.length() ==0) {
			return 0;
		}
		if (name1.length() > 0 && mName.length() == 0) {
			return 1;
		}
		if (name1.charAt(0) < mName.charAt(0)) {
			return 1;
		} else if (name1.charAt(0) > mName.charAt(0)) {
			return -1;
		} else {
			return 0;
		}
	}
}
